import request from '@/utils/request'

const urls = {
    list: '/index/tetr/list', // 查询完整列表
    page: '/index/tetr/page', // 查询分页列表
    roomInfo: '/index/tetr/roomInfo',
    bvGetPlayerUrlInfo: '/index/tetr/bvGetPlayerUrlInfo',
    bvHashGetStreamFileUrl: '/index/tetr/bvHashGetStreamFileUrl',
    buildTechminoRandomField: '/index/tetr/buildTechminoRandomField',
    matrixToTechmino: '/index/tetr/matrixToTechmino',
    uploadGetReviewCode: '/index/tetr/uploadGetReviewCode',
}

// 获取房间列表
export const list = (params) => {
    return request.post(urls.list, params)
}

// 获取房间列表(带分页)
export const page = (params) => {
    return request.post(urls.page, params)
}

// 获取房间信息
export const roomInfo = (params) => {
    return request.post(urls.roomInfo, params)
}

// 获取视频信息
export const bvGetPlayerUrlInfo = (params) => {
    return request.post(urls.bvGetPlayerUrlInfo, params)
}

// 获取视频信息
export const bvHashGetStreamFileUrl = (params) => {
    return request.post(urls.bvHashGetStreamFileUrl, params, { timeout: 1000 * 3600 })
}

// 生成随机场地
export const buildTechminoRandomField = (params) => {
    return request.post(urls.buildTechminoRandomField, params)
}

// 矩阵转为场地
export const matrixToTechmino = (params) => {
    return request.post(urls.matrixToTechmino, params)
}

// 获取上传验证码
export const uploadGetReviewCode = (params) => {
    return request.post(urls.uploadGetReviewCode, params)
}
